﻿using BlindTestLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;

namespace BlindTestServerService
{
    /// <summary>
    /// Implémentation de l'interface du service WCF
    /// </summary>
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Single)]
    class RemoteService:IRemoteService
    {

        string path = "C:\\Users\\Smouha\\Desktop\\JAZZ";
        public void SayHello(string clientName)
        {

            System.Console.WriteLine("Hello Mr : {0}",clientName);
        }



        public PartyResponse GetParty()
        {
            BlindTestProcessor processor = new BlindTestProcessor();
            PartyResponse party = processor.selectFile(path);
            Console.WriteLine("je reçoie une demande de partie !! et je la song choisie est"+party.SelectedSong.Name);

            

            return party;
        }

        public Boolean checkClientChoice(String clientChoice, String fileSelected)
        {
            BlindTestProcessor processor = new BlindTestProcessor();
            Boolean checkSong = processor.CheckSong(clientChoice,fileSelected);
            return checkSong;
        }

    }
}
